package main

import (
	"fmt"
	"io/ioutil"
)

func main() {
	//讲d:/abc.txt 文件内容写入到 e:/kkk.txt

	//1.首先将 d:abc.txt 内容读取到内存
	//2.将读取到的内容写入 e:/kkk.txt
	file1path := "d:/abc.txt"
	file2path := "e:/kkk.txt"

	data, err := ioutil.ReadFile(file1path)
	if err != nil {
		fmt.Printf("read file err=%v\n", err)
		return
	}
	err = ioutil.WriteFile(file2path, data, 0666)
	if err != nil {
		fmt.Printf("read file err=%v\n", err)
	}

}
